/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pageBeans;

import entities.Application;
import entities.EducationSection;
import entities.EnglishSection;
import entities.Experience;
import entities.Institute;
import entities.PersonalSection;
import entities.ProfessionalSection;
import entities.ProgrammingCourse;
import entities.ProgrammingSection;
import entities.SelfStudy;
import entities.SelfStudySection;
import java.awt.event.ActionEvent;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.inject.Inject;
import org.primefaces.event.FlowEvent;
import persistence.GenericDAO;
import persistence.GenericDAOImpl;
import util.Evaluator;

/**
 *
 * @author Admus
 */
@Named(value = "wizardPageBean")
@SessionScoped
public class WizardPageBean implements Serializable {

    private boolean disabled = false;
    private GenericDAO<Application, Long> dao = new GenericDAOImpl<Application, Long>(Application.class);
    private List countries;
    @Inject
    private LoginPageBean loginPageBean;
    private String nextSection;
    //application of the page
    private Application application;
    private PersonalSection personalSection;
    private EnglishSection englishSection;
    private EducationSection educationSection;
    private ProgrammingSection programmingSection;
    private ProfessionalSection professionalSection;
    private SelfStudySection selfstudySection;
    //section status
    private String personalStatus;
    private String englishStatus;
    private String educationStatus;
    private String programmingStatus;
    private String professionalStatus;
    private String selfstudyStatus;
    //section personal
    private Boolean personalpreApplied;
    private String personalfirstName;
    private String personalmiddleName;
    private String personallastName;
    private String personalsex;
    private String personalmaritalStatus;
    private String personalcountryOfCitizenship;
    private String personalcountryOfBirth;
    private String personalday;
    private String personalmonth;
    private String personalyear;
    private String personalemailAddress;
    private String personalskypeID;
    private String personalphone;
    private String personalcity;
    private String personalcurrentCountry;
    private String personalmsProgram;
    private String personaldateOfmsProgram;
    private String personalagentCode;
    private String personalsource;
    //section english
    private String englishReadWrite;
    private String englishSpeak;
    private String englishUnderstand;
    private String englishToeflYear;
    private String englishToeflScore;
    private String englishGreYear;
    private String englishGreVerbalScore;
    private String englishGreVerbalPercentile;
    private String englishGreQuantitativeScore;
    private String englishGreQuantitativePercentile;
    private String englishGreAnalyticalScore;
    private String englishGreAnalyticalPercentile;
    //section education
    private String educationDegreeYears;
    private String educationDegreeField;
    private String educationDegreeDegree;
    private String educationGPACountry;
    private String educationGPAScale;
    private String educationGPA;
    private List<Institute> institutes = new ArrayList<Institute>(0);
    private String educationTotalYears;
    private String educationTotalMonths;
    //section programming
    private List<ProgrammingCourse> programmingprogCourses = new ArrayList<ProgrammingCourse>(0);
    private String programmingjavaLangSkill;
    private String programmingcplusLangSkill;
    private String programmingcsharpLangSkill;
    private String programmingcLangSkill;
    private String programmingpascalLangSkill;
    private String programmingvbLangSkill;
    private String programmingoverallLangSkill;
    private String programmingproficientLang;
    private boolean programmingdataStacksNotStudied;
    private boolean programmingdataStacksSelfStudy;
    private boolean programmingdataStacksWorkExperience;
    private boolean programmingdataStacksAcademicCourse;
    private boolean programmingdataQueuesNotStudied;
    private boolean programmingdataQueuesSelfStudy;
    private boolean programmingdataQueuesWorkExperience;
    private boolean programmingdataQueuesAcademicCourse;
    private boolean programmingdataLinkedListNotStudied;
    private boolean programmingdataLinkedListSelfStudy;
    private boolean programmingdataLinkedListWorkExperience;
    private boolean programmingdataLinkedListAcademicCourse;
    private String programmingmathCourse;
    private boolean programmingmathCalculusI;
    private boolean programmingmathCalculusII;
    private boolean programminglinearAlgebra;
    private boolean programmingprobabilityStatistics;
    //section professional
    private String proLanguage;
    private String proSummary;
    private String proCareerYear;
    private String proCareerMonth;
    private List<Experience> proExperiences = new ArrayList<Experience>(0);
    //section self study
    private List<SelfStudy> selfStudies = new ArrayList<SelfStudy>(0);

    public WizardPageBean() {
        countries = new ArrayList();
        SelectItem option = new SelectItem("usa", "USA");
        countries.add(option);
        option = new SelectItem("tr", "Turkey");
        countries.add(option);
        option = new SelectItem("uz", "Uzbekistan");
        countries.add(option);

        institutes.add(new Institute());
        proExperiences.add(new Experience());
        selfStudies.add(new SelfStudy());
        programmingprogCourses.add(new ProgrammingCourse());
    }

    public void enlargeList() {
        Institute ins = new Institute();
        institutes.add(ins);
    }

    public void reduceList() {
        institutes.remove(institutes.size() - 1);
    }

    public void enlargeProList() {
        Experience ins = new Experience();
        proExperiences.add(ins);
    }

    public void reduceProList() {
        proExperiences.remove(proExperiences.size() - 1);
    }

    public void enlargeSelfList() {
        SelfStudy ins = new SelfStudy();
        selfStudies.add(ins);
    }

    public void reduceSelfList() {
        selfStudies.remove(selfStudies.size() - 1);
    }

    public void enlargeCourseList() {
        ProgrammingCourse ins = new ProgrammingCourse();
        programmingprogCourses.add(ins);
    }

    public void reduceCourseList() {
        programmingprogCourses.remove(programmingprogCourses.size() - 1);
    }

    public void staffLogged(Application app) {
        this.application = app;
        this.educationSection = application.getEducationSection();
        this.englishSection = application.getEnglishSection();
        this.personalSection = application.getPersonalSection();
        this.professionalSection = application.getProfessionalSection();
        this.programmingSection = application.getProgrammingSection();
        this.selfstudySection = application.getSelfStudySection();

        this.setDisabled(true);
    }

    public void applicantLogged() {
        this.application = loginPageBean.getApplicant().getApplication();
        this.educationSection = application.getEducationSection();
        this.englishSection = application.getEnglishSection();
        this.personalSection = application.getPersonalSection();
        this.professionalSection = application.getProfessionalSection();
        this.programmingSection = application.getProgrammingSection();
        this.selfstudySection = application.getSelfStudySection();

        if (application.getStatus() == Application.Status.SUBMITTED) {
            this.setDisabled(true);
        } else {
            this.setDisabled(false);
        }
    }

    public void submitApplication(ActionEvent actionEvent) {
        this.application.setStatus(Application.Status.SUBMITTED);
        this.application.setEvaluation(new Evaluator().evaluate(application));
        dao.update(application);
        
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Submit is successful", "Application is successfully submitted.");
        FacesContext.getCurrentInstance().addMessage(null, fm);
    }

    public void saveEnglishSection(ActionEvent actionEvent) {
        if (this.englishSection == null) {
            englishSection = new EnglishSection();
        }
        englishSection.setEnglishGreAnalyticalPercentile(englishGreAnalyticalPercentile);
        englishSection.setEnglishGreAnalyticalScore(englishGreAnalyticalScore);
        englishSection.setEnglishGreQuantitativePercentile(englishGreQuantitativePercentile);
        englishSection.setEnglishGreQuantitativeScore(englishGreQuantitativeScore);
        englishSection.setEnglishGreVerbalPercentile(englishGreVerbalPercentile);
        englishSection.setEnglishGreVerbalScore(englishGreVerbalScore);
        englishSection.setEnglishGreYear(englishGreYear);
        englishSection.setEnglishReadWrite(englishReadWrite);
        englishSection.setEnglishSpeak(englishSpeak);
        englishSection.setEnglishToeflScore(englishToeflScore);
        englishSection.setEnglishToeflYear(englishToeflYear);
        englishSection.setEnglishUnderstand(englishUnderstand);

        englishSection.setApplication(application);
        application.setEnglishSection(englishSection);

        dao.update(application);
        
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "English Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);
    }

    public void saveEducationSection(ActionEvent actionEvent) {
        if (this.educationSection == null) {
            educationSection = new EducationSection();
        }
        educationSection.setEducationDegreeDegree(educationDegreeDegree);
        educationSection.setEducationDegreeField(educationDegreeField);
        educationSection.setEducationDegreeYears(educationDegreeYears);
        educationSection.setEducationGPA(educationGPA);
        educationSection.setEducationGPACountry(educationGPACountry);
        educationSection.setEducationGPAScale(educationGPAScale);
        educationSection.setEducationTotalMonths(educationTotalMonths);
        educationSection.setEducationTotalYears(educationTotalYears);
        educationSection.setInstitutes(institutes);
        for (Institute ins : institutes) {
            ins.setEducationSection(educationSection);
        }

        educationSection.setApplication(application);
        application.setEducationSection(educationSection);

        dao.update(application);
                    
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "Education Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);
    }

    public void savePersonalSection(ActionEvent actionEvent) {
        if (this.personalSection == null) {
            personalSection = new PersonalSection();
        }
        personalSection.setPersonalagentCode(personalagentCode);
        personalSection.setPersonalcity(personalcity);
        personalSection.setPersonalcountryOfBirth(personalcountryOfBirth);
        personalSection.setPersonalcountryOfCitizenship(personalcountryOfCitizenship);
        personalSection.setPersonalcurrentCountry(personalcurrentCountry);
        personalSection.setPersonaldateOfmsProgram(personaldateOfmsProgram);
        personalSection.setPersonalemailAddress(personalemailAddress);
        personalSection.setPersonalfirstName(personalfirstName);
        personalSection.setPersonallastName(personallastName);
        personalSection.setPersonalmaritalStatus(personalmaritalStatus);
        personalSection.setPersonalmiddleName(personalmiddleName);
        personalSection.setPersonalmsProgram(personalmsProgram);
        personalSection.setPersonalphone(personalphone);
        personalSection.setPersonalpreApplied(personalpreApplied);
        personalSection.setPersonalsex(personalsex);
        personalSection.setPersonalskypeID(personalskypeID);
        personalSection.setPersonalsource(personalsource);

        Date date = new Date(Integer.parseInt(personalyear), Integer.parseInt(personalmonth), Integer.parseInt(personalday));
        personalSection.setPersonalDOB(date);

        personalSection.setApplication(application);
        application.setPersonalSection(personalSection);

        dao.update(application);
        
                
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "Personal Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);
    }

    public void saveProgrammingSection(ActionEvent actionEvent) {
        if (this.programmingSection == null) {
            programmingSection = new ProgrammingSection();
        }
        programmingSection.setProgrammingcLangSkill(programmingcLangSkill);
        programmingSection.setProgrammingcplusLangSkill(programmingcplusLangSkill);
        programmingSection.setProgrammingcsharpLangSkill(programmingcsharpLangSkill);
        programmingSection.setProgrammingdataLinkedListAcademicCourse(programmingdataLinkedListAcademicCourse);
        programmingSection.setProgrammingdataLinkedListNotStudied(programmingdataLinkedListNotStudied);
        programmingSection.setProgrammingdataLinkedListSelfStudy(programmingdataLinkedListSelfStudy);
        programmingSection.setProgrammingdataLinkedListWorkExperience(programmingdataLinkedListWorkExperience);
        programmingSection.setProgrammingdataQueuesAcademicCourse(programmingdataQueuesAcademicCourse);
        programmingSection.setProgrammingdataQueuesNotStudied(programmingdataQueuesNotStudied);
        programmingSection.setProgrammingdataQueuesSelfStudy(programmingdataQueuesSelfStudy);
        programmingSection.setProgrammingdataQueuesWorkExperience(programmingdataQueuesWorkExperience);
        programmingSection.setProgrammingdataStacksAcademicCourse(programmingdataStacksAcademicCourse);
        programmingSection.setProgrammingdataStacksNotStudied(programmingdataStacksNotStudied);
        programmingSection.setProgrammingdataStacksSelfStudy(programmingdataStacksSelfStudy);
        programmingSection.setProgrammingdataStacksWorkExperience(programmingdataStacksWorkExperience);
        programmingSection.setProgrammingjavaLangSkill(programmingjavaLangSkill);
        programmingSection.setProgramminglinearAlgebra(programminglinearAlgebra);
        programmingSection.setProgrammingmathCalculusI(programmingmathCalculusI);
        programmingSection.setProgrammingmathCalculusII(programmingmathCalculusII);
        programmingSection.setProgrammingmathCourse(programmingmathCourse);
        programmingSection.setProgrammingoverallLangSkill(programmingoverallLangSkill);
        programmingSection.setProgrammingpascalLangSkill(programmingpascalLangSkill);
        programmingSection.setProgrammingprobabilityStatistics(programmingprobabilityStatistics);
        programmingSection.setProgrammingproficientLang(programmingproficientLang);
        programmingSection.setProgrammingprogCourses(programmingprogCourses);
        programmingSection.setProgrammingvbLangSkill(programmingvbLangSkill);

        for (ProgrammingCourse pc : programmingprogCourses) {
            pc.setProgrammingSection(programmingSection);
        }

        programmingSection.setApplication(application);
        application.setProgrammingSection(programmingSection);

        dao.update(application);
        
                
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "Programming Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);

    }

    public void saveProfessionalSection(ActionEvent actionEvent) {
        if (this.professionalSection == null) {
            professionalSection = new ProfessionalSection();
        }
        
        professionalSection.setProCareerMonth(proCareerMonth);
        professionalSection.setProCareerYear(proCareerYear);
        professionalSection.setProLanguage(proLanguage);
        professionalSection.setProSummary(proSummary);
        professionalSection.setExperiences(proExperiences);
        
        for(Experience exp : proExperiences){
            exp.setProfessionalSection(professionalSection);
        }
        professionalSection.setApplication(application);
        application.setProfessionalSection(professionalSection);

        dao.update(application);
                
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "Professional Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);
    }

    public void saveSelfStudySection(ActionEvent actionEvent) {
        if (this.selfstudySection == null) {
            selfstudySection = new SelfStudySection();
        }
        
        selfstudySection.setSelfStudies(selfStudies);
        for(SelfStudy ss : selfStudies){
            ss.setSelfStudySection(selfstudySection);
        }
        selfstudySection.setApplication(application);
        application.setSelfStudySection(selfstudySection);

        dao.update(application);
                
        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "Save is successful", "Self Study Section is saved successfully");
        FacesContext.getCurrentInstance().addMessage(null, fm);
        
    }

    public String onFlowProcess(FlowEvent event) {
        return event.getNewStep();
//        switch (sections.size()) {
//            case 0:
//                sectionName = "Personal Details";
//                break;
//            case 1:
//                sectionName = "English Proficiency";
//                break;
//            case 2:
//                sectionName = "Educational History";
//                break;
//            case 3:
//                sectionName = "Programming Experience";
//                break;
//            case 4:
//                sectionName = "Professional Experience";
//                break;
//            case 5:
//                sectionName = "Self Study";
//                break;
//            default:
//                sectionName = "Status";
//                break;
//        }
//        if (nextSection != null) {
//            String temp = new String(nextSection);
//            nextSection = null;
//            return temp;
//        } else {
//            return event.getNewStep();
//        }
    }

    public String getNextSection() {
        return nextSection;
    }

    public void setNextSection(String nextSection) {
        this.nextSection = nextSection;
    }

    public String getEducationStatus() {
        if (educationSection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public String getEnglishStatus() {
        if (englishSection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public String getPersonalStatus() {
        if (personalSection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public String getProfessionalStatus() {
        if (professionalSection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public String getProgrammingStatus() {
        if (programmingSection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public String getSelfstudyStatus() {
        if (selfstudySection != null) {
            return "Done";
        } else {
            return "Incomplete";
        }
    }

    public void setApplication(Application application) {
        this.application = application;
    }

    public void setCountries(List countries) {
        this.countries = countries;
    }

    public void setDao(GenericDAO<Application, Long> dao) {
        this.dao = dao;
    }

    public void setEducationDegreeDegree(String educationDegreeDegree) {
        this.educationDegreeDegree = educationDegreeDegree;
    }

    public void setEducationDegreeField(String educationDegreeField) {
        this.educationDegreeField = educationDegreeField;
    }

    public void setEducationDegreeYears(String educationDegreeYears) {
        this.educationDegreeYears = educationDegreeYears;
    }

    public void setEducationGPA(String educationGPA) {
        this.educationGPA = educationGPA;
    }

    public void setEducationGPACountry(String educationGPACountry) {
        this.educationGPACountry = educationGPACountry;
    }

    public void setEducationGPAScale(String educationGPAScale) {
        this.educationGPAScale = educationGPAScale;
    }

    public void setEducationSection(EducationSection educationSection) {
        this.educationSection = educationSection;
    }

    public void setEducationStatus(String educationStatus) {
        this.educationStatus = educationStatus;
    }

    public void setEducationTotalMonths(String educationTotalMonths) {
        this.educationTotalMonths = educationTotalMonths;
    }

    public void setEducationTotalYears(String educationTotalYears) {
        this.educationTotalYears = educationTotalYears;
    }

    public void setEnglishGreAnalyticalPercentile(String englishGreAnalyticalPercentile) {
        this.englishGreAnalyticalPercentile = englishGreAnalyticalPercentile;
    }

    public void setEnglishGreAnalyticalScore(String englishGreAnalyticalScore) {
        this.englishGreAnalyticalScore = englishGreAnalyticalScore;
    }

    public void setEnglishGreQuantitativePercentile(String englishGreQuantitativePercentile) {
        this.englishGreQuantitativePercentile = englishGreQuantitativePercentile;
    }

    public void setEnglishGreQuantitativeScore(String englishGreQuantitativeScore) {
        this.englishGreQuantitativeScore = englishGreQuantitativeScore;
    }

    public void setEnglishGreVerbalPercentile(String englishGreVerbalPercentile) {
        this.englishGreVerbalPercentile = englishGreVerbalPercentile;
    }

    public void setEnglishGreVerbalScore(String englishGreVerbalScore) {
        this.englishGreVerbalScore = englishGreVerbalScore;
    }

    public void setEnglishGreYear(String englishGreYear) {
        this.englishGreYear = englishGreYear;
    }

    public void setEnglishReadWrite(String englishReadWrite) {
        this.englishReadWrite = englishReadWrite;
    }

    public void setEnglishSection(EnglishSection englishSection) {
        this.englishSection = englishSection;
    }

    public void setEnglishSpeak(String englishSpeak) {
        this.englishSpeak = englishSpeak;
    }

    public void setEnglishStatus(String englishStatus) {
        this.englishStatus = englishStatus;
    }

    public void setEnglishToeflScore(String englishToeflScore) {
        this.englishToeflScore = englishToeflScore;
    }

    public void setEnglishToeflYear(String englishToeflYear) {
        this.englishToeflYear = englishToeflYear;
    }

    public void setEnglishUnderstand(String englishUnderstand) {
        this.englishUnderstand = englishUnderstand;
    }

    public void setInstitutes(List<Institute> institutes) {
        this.institutes = institutes;
    }

    public void setLoginPageBean(LoginPageBean loginPageBean) {
        this.loginPageBean = loginPageBean;
    }

    public void setPersonalSection(PersonalSection personalSection) {
        this.personalSection = personalSection;
    }

    public void setPersonalStatus(String personalStatus) {
        this.personalStatus = personalStatus;
    }

    public void setPersonalagentCode(String personalagentCode) {
        this.personalagentCode = personalagentCode;
    }

    public void setPersonalcity(String personalcity) {
        this.personalcity = personalcity;
    }

    public void setPersonalcountryOfBirth(String personalcountryOfBirth) {
        this.personalcountryOfBirth = personalcountryOfBirth;
    }

    public void setPersonalcountryOfCitizenship(String personalcountryOfCitizenship) {
        this.personalcountryOfCitizenship = personalcountryOfCitizenship;
    }

    public void setPersonalcurrentCountry(String personalcurrentCountry) {
        this.personalcurrentCountry = personalcurrentCountry;
    }

    public void setPersonaldateOfmsProgram(String personaldateOfmsProgram) {
        this.personaldateOfmsProgram = personaldateOfmsProgram;
    }

    public void setPersonalday(String personalday) {
        this.personalday = personalday;
    }

    public void setPersonalemailAddress(String personalemailAddress) {
        this.personalemailAddress = personalemailAddress;
    }

    public void setPersonalfirstName(String personalfirstName) {
        this.personalfirstName = personalfirstName;
    }

    public void setPersonallastName(String personallastName) {
        this.personallastName = personallastName;
    }

    public void setPersonalmaritalStatus(String personalmaritalStatus) {
        this.personalmaritalStatus = personalmaritalStatus;
    }

    public void setPersonalmiddleName(String personalmiddleName) {
        this.personalmiddleName = personalmiddleName;
    }

    public void setPersonalmonth(String personalmonth) {
        this.personalmonth = personalmonth;
    }

    public void setPersonalmsProgram(String personalmsProgram) {
        this.personalmsProgram = personalmsProgram;
    }

    public void setPersonalphone(String personalphone) {
        this.personalphone = personalphone;
    }

    public void setPersonalpreApplied(Boolean personalpreApplied) {
        this.personalpreApplied = personalpreApplied;
    }

    public void setPersonalsex(String personalsex) {
        this.personalsex = personalsex;
    }

    public void setPersonalskypeID(String personalskypeID) {
        this.personalskypeID = personalskypeID;
    }

    public void setPersonalsource(String personalsource) {
        this.personalsource = personalsource;
    }

    public void setPersonalyear(String personalyear) {
        this.personalyear = personalyear;
    }

    public void setProCareerMonth(String proCareerMonth) {
        this.proCareerMonth = proCareerMonth;
    }

    public void setProCareerYear(String proCareerYear) {
        this.proCareerYear = proCareerYear;
    }

    public void setProExperiences(List<Experience> proExperiences) {
        this.proExperiences = proExperiences;
    }

    public void setProLanguage(String proLanguage) {
        this.proLanguage = proLanguage;
    }

    public void setProSummary(String proSummary) {
        this.proSummary = proSummary;
    }

    public void setProfessionalSection(ProfessionalSection professionalSection) {
        this.professionalSection = professionalSection;
    }

    public void setProfessionalStatus(String professionalStatus) {
        this.professionalStatus = professionalStatus;
    }

    public void setProgrammingSection(ProgrammingSection programmingSection) {
        this.programmingSection = programmingSection;
    }

    public void setProgrammingStatus(String programmingStatus) {
        this.programmingStatus = programmingStatus;
    }

    public void setProgrammingcLangSkill(String programmingcLangSkill) {
        this.programmingcLangSkill = programmingcLangSkill;
    }

    public void setProgrammingcplusLangSkill(String programmingcplusLangSkill) {
        this.programmingcplusLangSkill = programmingcplusLangSkill;
    }

    public void setProgrammingcsharpLangSkill(String programmingcsharpLangSkill) {
        this.programmingcsharpLangSkill = programmingcsharpLangSkill;
    }

    public void setProgrammingdataLinkedListAcademicCourse(boolean programmingdataLinkedListAcademicCourse) {
        this.programmingdataLinkedListAcademicCourse = programmingdataLinkedListAcademicCourse;
    }

    public void setProgrammingdataLinkedListNotStudied(boolean programmingdataLinkedListNotStudied) {
        this.programmingdataLinkedListNotStudied = programmingdataLinkedListNotStudied;
    }

    public void setProgrammingdataLinkedListSelfStudy(boolean programmingdataLinkedListSelfStudy) {
        this.programmingdataLinkedListSelfStudy = programmingdataLinkedListSelfStudy;
    }

    public void setProgrammingdataLinkedListWorkExperience(boolean programmingdataLinkedListWorkExperience) {
        this.programmingdataLinkedListWorkExperience = programmingdataLinkedListWorkExperience;
    }

    public void setProgrammingdataQueuesAcademicCourse(boolean programmingdataQueuesAcademicCourse) {
        this.programmingdataQueuesAcademicCourse = programmingdataQueuesAcademicCourse;
    }

    public void setProgrammingdataQueuesNotStudied(boolean programmingdataQueuesNotStudied) {
        this.programmingdataQueuesNotStudied = programmingdataQueuesNotStudied;
    }

    public void setProgrammingdataQueuesSelfStudy(boolean programmingdataQueuesSelfStudy) {
        this.programmingdataQueuesSelfStudy = programmingdataQueuesSelfStudy;
    }

    public void setProgrammingdataQueuesWorkExperience(boolean programmingdataQueuesWorkExperience) {
        this.programmingdataQueuesWorkExperience = programmingdataQueuesWorkExperience;
    }

    public void setProgrammingdataStacksAcademicCourse(boolean programmingdataStacksAcademicCourse) {
        this.programmingdataStacksAcademicCourse = programmingdataStacksAcademicCourse;
    }

    public void setProgrammingdataStacksNotStudied(boolean programmingdataStacksNotStudied) {
        this.programmingdataStacksNotStudied = programmingdataStacksNotStudied;
    }

    public void setProgrammingdataStacksSelfStudy(boolean programmingdataStacksSelfStudy) {
        this.programmingdataStacksSelfStudy = programmingdataStacksSelfStudy;
    }

    public void setProgrammingdataStacksWorkExperience(boolean programmingdataStacksWorkExperience) {
        this.programmingdataStacksWorkExperience = programmingdataStacksWorkExperience;
    }

    public void setProgrammingjavaLangSkill(String programmingjavaLangSkill) {
        this.programmingjavaLangSkill = programmingjavaLangSkill;
    }

    public void setProgramminglinearAlgebra(boolean programminglinearAlgebra) {
        this.programminglinearAlgebra = programminglinearAlgebra;
    }

    public void setProgrammingmathCalculusI(boolean programmingmathCalculusI) {
        this.programmingmathCalculusI = programmingmathCalculusI;
    }

    public void setProgrammingmathCalculusII(boolean programmingmathCalculusII) {
        this.programmingmathCalculusII = programmingmathCalculusII;
    }

    public void setProgrammingmathCourse(String programmingmathCourse) {
        this.programmingmathCourse = programmingmathCourse;
    }

    public void setProgrammingoverallLangSkill(String programmingoverallLangSkill) {
        this.programmingoverallLangSkill = programmingoverallLangSkill;
    }

    public void setProgrammingpascalLangSkill(String programmingpascalLangSkill) {
        this.programmingpascalLangSkill = programmingpascalLangSkill;
    }

    public void setProgrammingprobabilityStatistics(boolean programmingprobabilityStatistics) {
        this.programmingprobabilityStatistics = programmingprobabilityStatistics;
    }

    public void setProgrammingproficientLang(String programmingproficientLang) {
        this.programmingproficientLang = programmingproficientLang;
    }

    public void setProgrammingprogCourses(List<ProgrammingCourse> programmingprogCourses) {
        this.programmingprogCourses = programmingprogCourses;
    }

    public void setProgrammingvbLangSkill(String programmingvbLangSkill) {
        this.programmingvbLangSkill = programmingvbLangSkill;
    }

    public void setSelfStudies(List<SelfStudy> selfStudies) {
        this.selfStudies = selfStudies;
    }

    public void setSelfstudySection(SelfStudySection selfstudySection) {
        this.selfstudySection = selfstudySection;
    }

    public void setSelfstudyStatus(String selfstudyStatus) {
        this.selfstudyStatus = selfstudyStatus;
    }

    public Application getApplication() {
        return application;
    }

    public List getCountries() {
        return countries;
    }

    public GenericDAO<Application, Long> getDao() {
        return dao;
    }

    //getters start
    public String getEducationDegreeDegree() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationDegreeDegree();
        } else {
            return educationDegreeDegree;
        }
    }

    public String getEducationDegreeField() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationDegreeField();
        } else {
            return educationDegreeField;
        }
    }

    public String getEducationDegreeYears() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationDegreeYears();
        } else {
            return educationDegreeYears;
        }
    }

    public String getEducationGPA() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationGPA();
        } else {
            return educationGPA;
        }
    }

    public String getEducationGPACountry() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationGPACountry();
        } else {
            return educationGPACountry;
        }
    }

    public String getEducationGPAScale() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationGPAScale();
        } else {
            return educationGPAScale;
        }
    }

    public EducationSection getEducationSection() {
        return educationSection;
    }

    public String getEducationTotalMonths() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationTotalMonths();
        } else {
            return educationTotalMonths;
        }
    }

    public String getEducationTotalYears() {
        if (this.educationSection != null) {
            return this.educationSection.getEducationTotalYears();
        } else {
            return educationTotalYears;
        }
    }
// english section getters

    public String getEnglishGreAnalyticalPercentile() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreAnalyticalPercentile();
        } else {
            return englishGreAnalyticalPercentile;
        }
    }

    public String getEnglishGreAnalyticalScore() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreAnalyticalScore();
        } else {
            return englishGreAnalyticalScore;
        }
    }

    public String getEnglishGreQuantitativePercentile() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreQuantitativePercentile();
        } else {
            return englishGreQuantitativePercentile;
        }
    }

    public String getEnglishGreQuantitativeScore() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreQuantitativeScore();
        } else {
            return englishGreQuantitativeScore;
        }
    }

    public String getEnglishGreVerbalPercentile() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreVerbalPercentile();
        } else {
            return englishGreVerbalPercentile;
        }
    }

    public String getEnglishGreVerbalScore() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreVerbalScore();
        } else {
            return englishGreVerbalScore;
        }
    }

    public String getEnglishGreYear() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishGreYear();
        } else {
            return englishGreYear;
        }
    }

    public String getEnglishReadWrite() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishReadWrite();
        } else {
            return englishReadWrite;
        }
    }

    public EnglishSection getEnglishSection() {
        return englishSection;
    }

    public String getEnglishSpeak() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishSpeak();
        } else {
            return englishSpeak;
        }
    }

    public String getEnglishToeflScore() {

        if (this.englishSection != null) {
            return this.englishSection.getEnglishToeflScore();
        } else {
            return englishToeflScore;
        }
    }

    public String getEnglishToeflYear() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishToeflYear();
        } else {
            return englishToeflYear;
        }
    }

    public String getEnglishUnderstand() {
        if (this.englishSection != null) {
            return this.englishSection.getEnglishUnderstand();
        } else {
            return englishUnderstand;
        }
    }

// start -------------institute--------------------------- getters
    public List<Institute> getInstitutes() {
        if (this.educationSection != null) {
            institutes = this.educationSection.getInstitutes();
        }
        return institutes;
    }

    public LoginPageBean getLoginPageBean() {
        return loginPageBean;
    }

    // start ------------- personal section --------------------------- getters
    public PersonalSection getPersonalSection() {
        return personalSection;
    }

    public String getPersonalagentCode() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalagentCode();
        } else {
            return personalagentCode;
        }

    }

    public String getPersonalcity() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalcity();
        } else {
            return personalcity;
        }
    }

    public String getPersonalcountryOfBirth() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalcountryOfBirth();
        } else {
            return personalcountryOfBirth;
        }
    }

    public String getPersonalcountryOfCitizenship() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalcountryOfCitizenship();
        } else {
            return personalcountryOfCitizenship;
        }
    }

    public String getPersonalcurrentCountry() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalcurrentCountry();
        } else {
            return personalcurrentCountry;
        }
    }

    public String getPersonaldateOfmsProgram() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonaldateOfmsProgram();
        } else {
            return personaldateOfmsProgram;
        }
    }

    public String getPersonalday() {
        if (this.personalSection != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(this.personalSection.getPersonalDOB());
            int day = cal.get(Calendar.DAY_OF_MONTH);
            return Integer.toString(day);
        } else {
            return personalday;
        }
    }

    public String getPersonalemailAddress() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalemailAddress();
        } else {
            return personalemailAddress;
        }
    }

    public String getPersonalfirstName() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalfirstName();
        } else {
            return personalfirstName;
        }
    }

    public String getPersonallastName() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonallastName();
        } else {
            return personallastName;
        }
    }

    public String getPersonalmaritalStatus() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalmaritalStatus();
        } else {
            return personalmaritalStatus;
        }
    }

    public String getPersonalmiddleName() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalmiddleName();
        } else {
            return personalmiddleName;
        }
    }

    public String getPersonalmonth() {
        if (this.personalSection != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(this.personalSection.getPersonalDOB());
            int month = cal.get(Calendar.MONTH);
            return Integer.toString(month);
        }
        return personalmonth;
    }

    public String getPersonalmsProgram() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalmsProgram();
        } else {
            return personalmsProgram;
        }
    }

    public String getPersonalphone() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalphone();
        } else {
            return personalphone;
        }
    }

    public Boolean getPersonalpreApplied() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalpreApplied();
        } else {
            return personalpreApplied;
        }
    }

    public String getPersonalsex() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalsex();
        } else {
            return personalsex;
        }
    }

    public String getPersonalskypeID() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalskypeID();
        } else {
            return personalskypeID;
        }
    }

    public String getPersonalsource() {
        if (this.personalSection != null) {
            return this.personalSection.getPersonalsource();
        } else {
            return personalsource;
        }
    }

    public String getPersonalyear() {
        if (this.personalSection != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(this.personalSection.getPersonalDOB());
            int year = cal.get(Calendar.YEAR);
            return Integer.toString(year);
        }

        return personalyear;
    }

    // end ------------- personal section --------------------------- getters
    //------------------------------------------------------------------------//
    // start ------------- professional section --------------------------- getters
    public String getProCareerMonth() {
        if (this.professionalSection != null) {
            return this.professionalSection.getProCareerMonth();
        } else {
            return proCareerMonth;
        }
    }

    public String getProCareerYear() {
        if (this.professionalSection != null) {
            return this.professionalSection.getProCareerYear();
        } else {
            return proCareerYear;
        }
    }

    public List<Experience> getProExperiences() {
        if (this.professionalSection != null) {
            proExperiences = this.professionalSection.getExperiences();
        }
        return proExperiences;
    }

    public String getProLanguage() {
        if (this.professionalSection != null) {
            return this.professionalSection.getProLanguage();
        } else {
            return proLanguage;
        }
    }

    public String getProSummary() {
        if (this.professionalSection != null) {
            return this.professionalSection.getProSummary();
        } else {
            return proSummary;
        }
    }

    public ProfessionalSection getProfessionalSection() {
        return professionalSection;
    }

    // end ------------- professional section --------------------------- getters
    //------------------------------------------------------------------------//
    // start ------------- programming section --------------------------- getters
    public ProgrammingSection getProgrammingSection() {

        return programmingSection;
    }

    public String getProgrammingcLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingcLangSkill();
        } else {
            return programmingcLangSkill;
        }
    }

    public String getProgrammingcplusLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingcplusLangSkill();
        } else {
            return programmingcplusLangSkill;
        }
    }

    public String getProgrammingcsharpLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingcsharpLangSkill();
        } else {
            return programmingcsharpLangSkill;
        }
    }

    public boolean isProgrammingdataLinkedListAcademicCourse() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataLinkedListAcademicCourse();
        } else {
            return programmingdataLinkedListAcademicCourse;
        }
    }

    public boolean isProgrammingdataLinkedListNotStudied() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataLinkedListNotStudied();
        } else {
            return programmingdataLinkedListNotStudied;
        }
    }

    public boolean isProgrammingdataLinkedListSelfStudy() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataLinkedListSelfStudy();
        } else {
            return programmingdataLinkedListSelfStudy;
        }
    }

    public boolean isProgrammingdataLinkedListWorkExperience() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataLinkedListWorkExperience();
        } else {
            return programmingdataLinkedListWorkExperience;
        }
    }

    public boolean isProgrammingdataQueuesAcademicCourse() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataQueuesAcademicCourse();
        } else {
            return programmingdataQueuesAcademicCourse;
        }
    }

    public boolean isProgrammingdataQueuesNotStudied() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataQueuesNotStudied();
        } else {
            return programmingdataQueuesNotStudied;
        }
    }

    public boolean isProgrammingdataQueuesSelfStudy() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataQueuesSelfStudy();
        } else {
            return programmingdataQueuesSelfStudy;
        }
    }

    public boolean isProgrammingdataQueuesWorkExperience() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataQueuesWorkExperience();
        } else {
            return programmingdataQueuesWorkExperience;
        }
    }

    public boolean isProgrammingdataStacksAcademicCourse() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataStacksAcademicCourse();
        } else {
            return programmingdataStacksAcademicCourse;
        }
    }

    public boolean isProgrammingdataStacksNotStudied() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataStacksNotStudied();
        } else {
            return programmingdataStacksNotStudied;
        }
    }

    public boolean isProgrammingdataStacksSelfStudy() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataStacksSelfStudy();
        } else {
            return programmingdataStacksSelfStudy;
        }
    }

    public boolean isProgrammingdataStacksWorkExperience() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingdataStacksWorkExperience();
        } else {
            return programmingdataStacksWorkExperience;
        }
    }

    public String getProgrammingjavaLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingjavaLangSkill();
        } else {
            return programmingjavaLangSkill;
        }
    }

    public boolean isProgramminglinearAlgebra() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgramminglinearAlgebra();
        } else {
            return programminglinearAlgebra;
        }
    }

    public boolean isProgrammingmathCalculusI() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingmathCalculusI();
        } else {
            return programmingmathCalculusI;
        }
    }

    public boolean isProgrammingmathCalculusII() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingmathCalculusII();
        } else {
            return programmingmathCalculusII;
        }
    }

    public String getProgrammingmathCourse() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingmathCourse();
        } else {
            return programmingmathCourse;
        }
    }

    public String getProgrammingoverallLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingoverallLangSkill();
        } else {
            return programmingoverallLangSkill;
        }
    }

    public String getProgrammingpascalLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingpascalLangSkill();
        } else {
            return programmingpascalLangSkill;
        }
    }

    public boolean isProgrammingprobabilityStatistics() {
        if (this.programmingSection != null) {
            return this.programmingSection.isProgrammingprobabilityStatistics();
        } else {
            return programmingprobabilityStatistics;
        }
    }

    public String getProgrammingproficientLang() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingproficientLang();
        } else {
            return programmingproficientLang;
        }
    }

    public List<ProgrammingCourse> getProgrammingprogCourses() {

        if (this.programmingSection != null) {
            programmingprogCourses = this.programmingSection.getProgrammingprogCourses();
        }
        return programmingprogCourses;
    }

    public String getProgrammingvbLangSkill() {
        if (this.programmingSection != null) {
            return this.programmingSection.getProgrammingvbLangSkill();
        } else {
            return programmingvbLangSkill;
        }
    }

    public List<SelfStudy> getSelfStudies() {
        if (this.selfstudySection != null) {
            selfStudies = this.selfstudySection.getSelfStudies();
        }
        return selfStudies;
    }

    public SelfStudySection getSelfstudySection() {
        return selfstudySection;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
